<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/purchasedetailsproductfolder/purchasedetailsproduct.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/system/purchasedetailsproductfolder/purchasedetailsproduct.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'ProcurementId',
                footer: "Foots",
                cnName: '采购产品',
                name: 'purchasedetailsproductfolder/purchasedetailsproduct',
                url: "/purchasedetailsproduct/",
                sortName: "ProcurementId"
            });
            const editFormFields = ref({"PurchaseId":"","ProductName":"","ProductId":"","Specification":"","UnitId":"","Price":"","ProductNum":"","ProductTotal":""});
            const editFormOptions = ref([[{"title":"","field":"PurchaseId"},
                               {"title":"","field":"ProductName"}],
                              [{"title":"","field":"ProductId"},
                               {"title":"","field":"Specification"}],
                              [{"title":"","field":"UnitId"},
                               {"title":"","field":"Price","type":"decimal"}],
                              [{"title":"产品数量","field":"ProductNum","type":"number"},
                               {"title":"产品总价","field":"ProductTotal","type":"decimal"}]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'ProcurementId',title:'ProcurementId',type:'string',width:120,require:true,align:'left',sort:true},
                       {field:'PurchaseId',title:'PurchaseId',type:'string',width:120,align:'left'},
                       {field:'ProductName',title:'ProductName',type:'string',width:120,align:'left'},
                       {field:'ProductId',title:'ProductId',type:'string',width:120,align:'left'},
                       {field:'Specification',title:'Specification',type:'string',width:120,align:'left'},
                       {field:'UnitId',title:'UnitId',type:'string',width:120,align:'left'},
                       {field:'Price',title:'Price',type:'decimal',width:120,align:'left'},
                       {field:'ProductNum',title:'产品数量',type:'int',width:120,align:'left'},
                       {field:'ProductTotal',title:'产品总价',type:'decimal',width:120,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
